package oop.core.area;
import oop.core.Updateable;
import oop.core.entity.Entity;

/**
 * This is the abstract class that creates the unified type for all AreaEffects
 */
public abstract class AreaEffect implements Updateable{
	
	protected boolean isOn;
	protected long delay;
	
	/**
	 * @param isOn If the AreaEffect is active
	 * @param delay How long between each time the AreaEffect takes effect
	 */
	public AreaEffect(boolean isOn, long delay) {
		this.isOn = isOn;
		this.delay = delay;
	}
	
	/**
	 * 
	 * @param ent The entity being affected by the areaEffect
	 * @return Returns if the effect happened (based on isOn)
	 */
	public abstract boolean doEffect(Entity ent);
	
	/**
	 * The method called by the scheduler to indicate to the AreaEffect that it should be active again
	 */
	public void update()
	{
		isOn = true;
	}
	
	public long getDelay(){
		return delay;
	}
}

